<template>
		<div class="wrap-case-detail">
			<div class="detail-nav-title">
				<router-link tag='a' :to="'/index'" >首页</router-link> >
				<router-link tag='a' :to="'/company'" >装修公司</router-link> >
				<a>{{detail.name}}</a>
			</div>
			<div class="detail-head">
				<div class="detail-headdesign-left">
					<img src="image/clogo.jpg" alt="">
				</div>
				<div class="detail-head-right">
					<h2>{{detail.name}}</h2>
					<p>成立时间：{{detail.establishment}}</p>
					<p>注册资金：{{detail.capital}}万</p>
					<p>公司简介：{{detail.describe}}</p>
				</div>
			</div>
			<div class="detail-box">
				<div class="detail-box-pub" style="margin-top:40px;">
					<div class="title2-box">
						<span>设计方案</span>
						<!-- <a href="">更多>></a> -->
					</div>
					<div class="wrap-imgcase2" style="margin-top:10px;min-height:0">
						<div class="imgcase-box" v-for="(item, index) in detail.schemes" :key="index" v-if="index<3" @click="goCase(item.schemeIndex)">
							<div class="cb-img">
								<img :src="item.image">
							</div>
							<div class="cd-text">
								<span class="cb-title">{{item.title}}</span>
								<span class="cb-sum">{{item.imageCount}}张</span>
							</div>
						</div>
						<div class="clear"></div>
					</div>
				</div>
				<div class="title2-box" style="margin-top: 30px;margin-bottom:15px;">
					<span>设计方案</span>
					<!-- <a href="">更多>></a> -->
				</div>
				<div class="wrap-design-two2">
					<div class="det-pub" v-for="(item, index) in detail.designers" :key="index" v-if="index<3">
						<img :src="item.image">
						<div class="det-text">
							<p class="det-text-name">{{item.name}}</p>
							<p class="det-text-say">{{item.describe}}</p>
							<p class="det-text-good">擅长风格：{{item.strongs.join('、')}}</p>
						</div>
					</div>
				</div>
			</div>
		</div>
</template>

<script>
export default {
  data () {
    return {
    	detail: [],
    	pageindex: 0,
    	pagelimit: 3,
    	total: ''
    }
  },
  methods: {
  	getQuery () {
  		var that = this
  		var id = that.$route.query.id
  		if (id) {
  			that.$axios.request('/CompanyInfo/Detail', {
  				CompanyIndex: id,
  				Pageindex: that.pageindex,
  				Pagelimit: that.pagelimit
  			})
  				.then((res) => {
  					if (res.code === 0) {
  						that.detail = res.data
  						that.detail.establishment = that.detail.establishment.split(' ')[0]
  						// that.total = res.data.total
  					}
  				})
  		} else {
  			that.$router.push({
  				name: 'company'
  			})
  		}
  	},
  	goCase: function (id) {
  		var that = this
  		that.$axios.goCase(id)
  	},
  	handleCurrentChange (val) {
      var that = this
      that.pageindex = val
      that.getQuery()
    },
  },
  mounted () {
  	this.getQuery()
  }
}
</script>
